
var xPos = 20; 
var yPos = 10; 
img.style.right= xPos; 
img.style.top = yPos; 
var step = 1; 
var delay = 5; 
var width,height 
var y = 1;  
var interval; 
img.visibility = "visible"; 
function movePos() 
{ 
height = document.body.clientHeight; 
Hoffset = img.offsetHeight;  
if (y) 
{ 
yPos = yPos + step; 
} 
else 
{ 
yPos = yPos - step; 
} 
if (yPos < 0) 
{ 
y = 1; 
yPos = 0; 
} 
if (yPos >= (height - Hoffset)) 
{ 
y = 0; 
yPos = (height - Hoffset); 
}  
img.style.top = yPos + document.body.scrollTop; 
} 
function start() 
{ 
interval = setInterval('movePos()', delay); 
} 
function pause_resume() 
{ 
clearInterval(interval); 
} 
start(); 

